package de.uni.muenster.idw2.autoverbal.data;

import java.util.ArrayList;
import java.util.Iterator;

import de.uni.muenster.idw2.data.Edge;
import de.uni.muenster.idw2.data.Vertex;

public class Vertex_Association {
	private Vertex vertex;
	private ArrayList<Edge> edgeList;
	private boolean straight;
	//include pairs?
	
	public Vertex_Association(Vertex vertex){
		this.vertex = vertex;
		edgeList = new ArrayList<Edge>();
		straight = false;
	}
	
	public boolean hasStraight() {
		return straight;
	}
	
//	public boolean hasStraight(Edge edge){
//		Iterator<Edge> edgeIter = edgeList.iterator();
//		boolean found = false;
//		straightSearch:
//		while(!found && edgeIter.hasNext()){
//			Edge tempE = edgeIter.next();
//			if(tempE.get)
//		}
//		return found
//	}
	
	/**
	 * set to true if pairs associated with vertex contain a straight line.
	 * This is needed to determine if a turning pair is at a T-junction or not.
	 * @param straight
	 */
	public void setStraight(boolean straight) {
		this.straight = straight;
	}

	public ArrayList<Edge> getEdgeList() {
		return edgeList;
	}

	public Vertex getVertex() {
		return vertex;
	}


	
	public int getDegree(){
		return edgeList.size()-1;
	}
	
	public void addEdge(Edge edge){
		edgeList.add(edge);
	}
	
	
}
